package com.java;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        try {
            int a = 10 / 0;

        }catch (Exception e){
            e.printStackTrace();
            Toast.makeText(MainActivity.this,"除数不能为0",Toast.LENGTH_LONG).show();
        }
    }
}
